#define _CRT_SECURE_NO_WARNINGS 
#include <stdio.h>
#include <math.h>

int Fib1(int n)
{
	if (n < 3)
		return  1;
	return Fib1(n - 1) + Fib1(n - 2);
}
int Fib2(int n)
{
	int a = 1, b = 1, c = 1;
	while (n >= 3)
	{
		c = a + b;
		a = b;
		b = c;
		n--;
	}
	return c;
}
int main()
{
	int n;
	scanf("%d", &n);
	printf("%d\n%d", Fib1(n), Fib2(n));
	return 0;
}


